package com.guoguo.service.impl;

import com.github.pagehelper.PageHelper;
import com.guoguo.base.PageBean;
import com.guoguo.base.PaginationContext;
import com.guoguo.entity.vo.ReplysVO;
import com.guoguo.mapper.ReplysMapper;
import com.guoguo.service.IReplysService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2017/8/14 0014.
 */
@Service
public class ReplysServiceImpl implements IReplysService {
    //ReplysMapper接口
    @Autowired
    private ReplysMapper replysMapper;

    /**
     * 评论回复列表
     * @param commId
     * @param pageNum
     * @return
     */
    public PageBean<ReplysVO> getReplyList(String commId,int pageNum) {
        PageHelper.startPage(pageNum, PaginationContext.getPageSize());
        List<ReplysVO> replysVOs = replysMapper.getReplyList(commId,pageNum);
        return new PageBean<ReplysVO>(replysVOs);
    }
}
